#!/usr/bin/perl

use Net::SMS::2Way;

my $bulksms_config_file = '/etc/sms.cfg';
my $batch_id = shift @ARGV;
my $usage = "Usage: $0 batch_id";

die "$usage\n" unless $batch_id;

my $sms = Net::SMS::2Way->new({config => $bulksms_config_file}) || die "FATAL: Could not create Net::SMS::2Way object!\n";

my @report = $sms->get_report( $batch_id );

my ($status_code, $status_desc, $info) = split( /\|/, shift(@inbox) );

die "FATAL: Status code = $status_code, desc = $status_desc\n" if $status_code > 0;

print join( "\n", @report);
